﻿using Coolite.Ext.Web;

namespace CooliteExamples.Web.Extensions
{
    public static class MenuItemExtensions
    {
        public static void SetMenuItemNavigationUrl(this MenuItem menuItem, string url, string loadingString)
        {
            menuItem.CustomConfig.Add(new ConfigItem()
                                          {
                                              Encode = false,
                                              Mode = ParameterMode.Value,
                                              Value = url,
                                              Name = "navigationUrl"
                                          });

            menuItem.CustomConfig.Add(new ConfigItem()
                                          {
                                              Encode = true,
                                              Mode = ParameterMode.Value,
                                              Value = loadingString,
                                              Name = "loadingText"
                                          });
        }
    }
}
